-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add keep_column(s)
params to to_dummies
#14844
base: main
Are you sure you want to change the base?
Conversation
keep-column[s]
params to to_dummies
keep_column[s]
params to to_dummies
What happens if one of the new dummy columns has the same name as the original column? |
That would have to be very contrived. The dummy columns are named by import polars as pl
df = pl.DataFrame({
"a": [1, 2, 3],
"a_1": [1, 2, 3],
})
df.to_dummies("a")
My guess is that one can contrive many scenarios to collide with polars' renaming, but it's not in our best interest to fight those edge cases. |
As long as it raises the same error. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14844 +/- ##
=======================================
Coverage 79.33% 79.33%
=======================================
Files 1548 1548
Lines 214245 214262 +17
Branches 2460 2460
=======================================
+ Hits 169968 169984 +16
- Misses 43719 43720 +1
Partials 558 558 ☔ View full report in Codecov by Sentry. |
keep_column[s]
params to to_dummies
keep_column[s]
params to to_dummies
8fa2a87
to
a9cd649
Compare
a9cd649
to
2d6e17f
Compare
keep_column[s]
params to to_dummies
keep_column(s)
params to to_dummies
hey - isn't the solution in #14831 (comment) good enough? perhaps that just needs documenting? |
It was a fairly simple implementation so no harm if you don't want to accept it--it felt like a reasonable parameter to me. Should I close? |
Resolves #14831. Simple boolean parameter that provides retention of columns. Default is
False
to preserve current usage.